package com.thd.springboottest.mybatisplus.mapper;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.thd.springboottest.mybatisplus.entity.SysUser;
import com.thd.springboottest.mybatisplus.vo.SysUserVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * com.thd.springboottest.mybatisplus.mapper.SysUserMapper
 *
 * @author: wanglei62
 * @DATE: 2019/9/20 16:12
 **/
//@Repository
@Mapper
public interface SysUserMapper extends BaseMapper<SysUser> {
    // 调用mapper.xml中SQL的方法
    public List<SysUser> queryList(SysUser sysUser);

    public List<SysUser> testQueryWrapperAndXml(@Param(Constants.WRAPPER) LambdaQueryWrapper<SysUser> qw, @Param(value="user") SysUser user);
    public List<SysUser> testParamAnnotation(@Param(value="user") SysUser user);



    List<SysUser> testSqlSegment(@Param(Constants.WRAPPER)QueryWrapper<SysUser> qw);


    /**
     * 分页自定义join查询
     * @param page
     * @param sysUser
     * @return
     */
    public IPage<SysUserVo> queryListByPage(IPage<SysUserVo> page, @Param("sysUserVo")  SysUserVo sysUserVo);


}
